@mixin clearfix {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}

@mixin scrollBar {
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}

@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}

@mixin pct($pct) {
  width: #{$pct};
  position: relative;
  margin: 0 auto;
}

@mixin triangle($width, $height, $color, $direction) {
  $width: $width/2;
  $color-border-style: $height solid $color;
  $transparent-border-style: $width solid transparent;
  height: 0;
  width: 0;

  @if $direction==up {
    border-bottom: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==right {
    border-left: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }

  @else if $direction==down {
    border-top: $color-border-style;
    border-left: $transparent-border-style;
    border-right: $transparent-border-style;
  }

  @else if $direction==left {
    border-right: $color-border-style;
    border-top: $transparent-border-style;
    border-bottom: $transparent-border-style;
  }
}

$px:px;

// @mixin clearfix {
//   &:after {
//     content: "";
//     display: table;
//     clear: both;
//   }
// }

// @mixin scrollBar {
//   &::-webkit-scrollbar-track-piece {
//     background: #d3dce6;
//   }

//   &::-webkit-scrollbar {
//     width: 6px;
//   }

//   &::-webkit-scrollbar-thumb {
//     background: #99a9bf;
//     border-radius: 20px;
//   }
// }

// @mixin relative {
//   position: relative;
//   width: 100%;
//   height: 100%;
// }



// 字体
@mixin fs($size) {
  font-size: #{$size}#{$px};
}

// 盒子
@mixin box($width,$height) {
  width: #{$width}#{$px};
  height: #{$height}#{$px};
}


// 圆角
@mixin radius($angle) {
  border-radius: #{$angle}#{$px};
  overflow: hidden;
}

// 间距
@mixin p($y,$x) {
  padding: #{$y}#{$px} #{$x}#{$px};
}
@mixin pad($t,$x,$b) {
  padding: #{$t}#{$px} #{$x}#{$px} #{$b}#{$px};
}

@mixin padding($t,$r,$b,$l) {
  padding: #{$t}#{$px} #{$r}#{$px} #{$b}#{$px} #{$l}#{$px};
}

// 外边距
@mixin mt($l) {
  margin-top: #{$l}#{$px};
}

@mixin mb($l) {
  margin-bottom: #{$l}#{$px};
}

@mixin ml($l) {
  margin-left: #{$l}#{$px};
}

@mixin mr($l) {
  margin-right: #{$l}#{$px};
}

@mixin m($y,$x) {
  margin: #{$y}#{$px} #{$x}#{$px};
}


// border
@mixin b($num,$color) {
  border: #{$num}#{$px} solid $color;
}

@mixin bt($num,$color) {
  border-top: #{$num}#{$px} solid $color;
}


@mixin bg-liner($left:#FEAD8E,$right:#FE4A15) {
  background-image: linear-gradient(45deg, $left, $right);
	color: #ffffff;  
}

// 多行隐藏
@mixin textoverflow($clamp:1) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  -o-text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $clamp;
  /*! autoprefixer: ignore next */
  -webkit-box-orient: vertical;
}

//flex box
@mixin flexbox($jc:space-between, $ai:center, $fd:row, $fw:nowrap) {
  display: flex;
  display: -webkit-flex;
  flex: 1;
  justify-content: $jc;
  -webkit-justify-content: $jc;
  align-items: $ai;
  -webkit-align-items: $ai;
  flex-direction: $fd;
  -webkit-flex-direction: $fd;
  flex-wrap: $fw;
  -webkit-flex-wrap: $fw;
}


